home *** CD-ROM | disk | FTP | other *** search
- /*
- * (c) Copyright 1992 by Panagiotis Tsirigotis
- * All rights reserved. The file named COPYRIGHT specifies the terms
- * and conditions for redistribution.
- */
-
-
- /*
- * $Id: filelog.h,v 1.1 1992/10/10 07:01:40 panos Exp $
- */
-
- /*
- * The file can be either open or closed.
- * When the file is closed, the state is always FL_CLOSED.
- * When the file is open, the state is:
- * FL_OPEN: if everything is ok
- * FL_SIZE: if the hard limit was exceeded
- * FL_ERROR: if an error occured
- */
- typedef enum { FL_CLOSED = 0, FL_OPEN, FL_SIZE, FL_ERROR } filelog_state_e ;
-
- struct filelog
- {
- int fd ;
- filelog_state_e state ;
- int close_on_exec ;
- int error ; /* error code when state is FL_ERROR */
- int size_control ; /* TRUE or FALSE */
- int issued_warning ; /* when the soft limit was exceeded */
- unsigned size ; /* current size */
- unsigned soft_limit ;
- unsigned hard_limit ;
- } ;
-
- #define FILELOG_ENABLE_SIZE_CONTROL( flp ) (flp)->size_control = TRUE
- #define FILELOG_DISABLE_SIZE_CONTROL( flp ) (flp)->size_control = FALSE
- #define FILELOG_SIZE_CONTROL( flp ) ( (flp)->size_control )
-
- #define FILELOG( xp ) ((struct filelog *)xp->data)
-
-